package com.banmao.struts2;

import com.opensymphony.xwork2.ActionSupport;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class UploadsAction extends ActionSupport {

    private static final long serialVersionUID = 1L;
    private List<File> uploadF;
    private List<String> uploadFContentType;
    private List<String> uploadFFileName;
    private List<String> uploadedFileNames =  new ArrayList<String>();

    public List<File> getUploadF() {
        return uploadF;
    }

    public void setUploadF(List<File> uploadF) {
        this.uploadF = uploadF;
    }

    public List<String> getUploadFContentType() {
        return uploadFContentType;
    }

    public void setUploadFContentType(List<String> uploadFContentType) {
        this.uploadFContentType = uploadFContentType;
    }

    public List<String> getUploadFFileName() {
        return uploadFFileName;
    }

    public void setUploadFFileName(List<String> uploadFFileName) {
        this.uploadFFileName = uploadFFileName;
    }

    public List<String> getUploadedFileNames() {
        return uploadedFileNames;
    }

    public String doUpload() {
        for (int i = 0; i < uploadFFileName.size(); i++) {
            uploadedFileNames.add(uploadFFileName.get(i));
        }
        return SUCCESS;
    }

}

